package gui;



import java.util.ArrayList;
import java.util.Map;

import skyproc.GRUP;
import skyproc.GRUP_TYPE;
import skyproc.MajorRecord;
import skyproc.MajorRecordNamed;
import skyproc.Mod;
import skyproc.SPDatabase;
import edit.HolderInterface;
import edit.SPDatabaseHolder;


public class TreeTableModModel extends AbstractTreeTableModel {
	
	static protected String[] cNames = {"FormID", "EditorID", "Name"};
	
	@SuppressWarnings("rawtypes")
	static protected Class[] cTypes = { TreeTableModel.class, String.class, String.class };
		
	public TreeTableModModel(HolderInterface root) {
		super(root);
	}

	@Override
	public int getColumnCount() {
		return cNames.length;
	}

	@Override
	public String getColumnName(int column) {
		return cNames[column];
	}

	@Override
	public Object getValueAt(Object parent, int column) {
		
		if(!(column == 0))
			return ((HolderInterface) parent).getValueAt(column - 1);
		
		return null;
	}

	@Override
	public Object getChild(Object parent, int index) {
		
		return ((HolderInterface) parent).getChild(parent, index);
		
	}

	@Override
	public int getChildCount(Object parent) {

		return ((HolderInterface) parent).getChildCount();
	}
	
	
	
	 /**
     * Returns the class for the particular column.
     */
    @SuppressWarnings("rawtypes")
	public Class getColumnClass(int column) {
    	return cTypes[column];
    }
    

}
